<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const promise1 = new Promise((resolve, reject) => {
            console.log('promise1');
        })
        console.log('1', promise1);

        // 从上至下，先遇到new Promise，执行该构造函数中的代码promise1
        // 然后执行同步代码1，此时promise1没有被resolve或者reject，因此状态还是pending
        // 结果
        // 'promise1'
        // '1' Promise{<pending>}
    </script>
</body>

</html>